import java.util.HashSet;
import java.util.Set;

public class test13 {
    public static void main(String[] args) {
        String s = "0100110001010001";
        Set<String> list = new HashSet<>();
        for (int i = 0 ; i < 16 ; i++){
            for (int j = i +1 ; j < 17 ; j++){
                String s1 = s.substring(i,j);
                list.add(s1);
            }
        }
        System.out.println(list.size());
    }
}
